import { createBrowserRouter } from 'react-router-dom'
import App from '../App'
import Home from '../props/home/Index'
import Opro from '../props/opro/Index'
import My from '../props/my/Index'
import Status from '../props/status/Index'
const routers = createBrowserRouter([
    {
        path: '/',
        element: <App></App>,
        children: [
            { index: true, element: <Home></Home> },
            {
                path: 'home',
                element: <Home></Home>
            },
            {
                path: 'my',
                element: <My></My>
            },
            {
                path: 'opro',
                element: <Opro></Opro>
            },
            {
                path: 'status',
                element: <Status></Status>
            }
        ]
    },
    {
        path: '/ticke',
        lazy: async () => {
            const { default: Ticket, loader } = await import('../props/ticke/Index')
            return {
                element: <Ticket></Ticket>,
                loader
            }
        }
    },
    {
        path: '/tickelist:id',
        lazy: async () => {
            const { default: Ticketlist,loader } = await import('../props/tickelist/Index')
            return {
                element: <Ticketlist></Ticketlist>,
                loader
            }
        }
    },
    {
        path: '/table',
        lazy: async () => {
            const { default: Table } = await import('../props/table/Index')
            return {
                element: <Table></Table>
            }
        }
    }

])
export default routers